

<%@ page import="org.tailor.Report" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'report.label', default: 'Report')}" />
  <title><g:message code="default.create.label" args="[entityName]" /></title>
</head>
<script type="text/javascript">
  <body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
    <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
    <h1><g:message code="default.create.label" args="[entityName]" /></h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${reportInstance}">
      <div class="errors">
        <g:renderErrors bean="${reportInstance}" as="list" />
      </div>
    </g:hasErrors>
    <g:jasperForm controller="report"
                      action="createReport"
                      id="1498"
                      jasper="jasperForm" >
      <div class="dialog">       

          <table>
            <tbody>

              <tr class="prop">
                <td valign="top" class="name">
                  <label for="fromDate"><g:message code="report.fromDate.label" default="From Date" /></label>
                </td>
                <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'fromDate', 'errors')}">
            <g:datePicker name="fromDate" precision="day" value="${reportInstance?.fromDate}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="toDate"><g:message code="report.toDate.label" default="To Date" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'toDate', 'errors')}">
            <g:datePicker name="toDate" precision="day" value="${reportInstance?.toDate}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="regions"><g:message code="report.regions.label" default="Regions" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'regions', 'errors')}">
            <g:select name="regions.id" from="${org.tailor.Regions.list()}" optionKey="id" value="${reportInstance?.regions?.id}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="design"><g:message code="report.design.label" default="Design" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'design', 'errors')}">
            <g:select name="design.id" from="${org.tailor.Design.list()}" optionKey="id" value="${reportInstance?.design?.id}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="fabric"><g:message code="report.fabric.label" default="Fabric" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'fabric', 'errors')}">
            <g:select name="fabric.id" from="${org.tailor.Fabric.list()}" optionKey="id" value="${reportInstance?.fabric?.id}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="tailor"><g:message code="report.tailor.label" default="Tailor" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'tailor', 'errors')}">
            <g:select name="tailor.id" from="${org.tailor.Tailor.list()}" optionKey="id" value="${reportInstance?.tailor?.id}"  />
            </td>
            </tr>

            <tr class="prop">
              <td valign="top" class="name">
                <label for="type"><g:message code="report.type.label" default="Type" /></label>
              </td>
              <td valign="top" class="value ${hasErrors(bean: reportInstance, field: 'type', 'errors')}">
            <g:select name="type" from="${reportInstance.constraints.type.inList}" value="${reportInstance?.type}" valueMessagePrefix="report.type"  />
            </td>
            </tr>
            </tbody>
          </table>          

      </div>
      <g:jasperButton format="xls" jasper="jaspe" text="XLS" />
        </g:jasperForm>


  </div>
</body>

</html>
